package com.ruoyi.web.controller.activity;


import com.ruoyi.activity.domain.ActFunFormRel;
import com.ruoyi.activity.service.IActFunFormRelService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenyufeng
 * @since 2024-03-02
 */
@RestController
@RequestMapping("/actFunFormRel")
public class ActFunFormRelController extends BaseController {

    @Resource
    private IActFunFormRelService actFunFormRelServiceImpl;

    @ApiOperation("保存功能标识与流程")
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    @ResponseBody
    public AjaxResult save(@RequestBody ActFunFormRel actFunFormRel) {
        actFunFormRelServiceImpl.save(actFunFormRel);
        return AjaxResult.success();
    }

    @ApiOperation("根据功能标识查询流程")
    @RequestMapping(value = "/getflowKeyByBusinessKey", method = RequestMethod.POST)
    @ResponseBody
    public AjaxResult getflowKeyByBusinessKey(@RequestParam String businessKey) {
        ActFunFormRel actFunFormRel = actFunFormRelServiceImpl.getflowKeyByFunctionelKey(businessKey);
        return AjaxResult.success(actFunFormRel);
    }
}

